<%@ Page Language="C#" autoeventwireup="true" %>
<%@ Import Namespace="SoftwareMonkeys.Scriptech.Diagnostics" %>
<%@ Import Namespace="SoftwareMonkeys.Scriptech.Business" %>
<%@ Import Namespace="SoftwareMonkeys.Scriptech.Scripts" %>
<%@ Import Namespace="SoftwareMonkeys.Scriptech.Web" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
	//using (LogGroup logGroup = LogGroup.StartDebug("Loading the script process output page."))
	//{
		using (TimeoutExtender extender = TimeoutExtender.NewMinutes(30))
		{
			ShowOutput();
		}
	//}
}

private void ShowOutput()
{
		Guid processID = new Guid(Request.QueryString["ProcessID"]);
		
		LogWriter.Debug("Process ID: " + processID.ToString());
		
		// TODO: Remove "false" parameter below
		
		ScriptProcess process = RetrieveStrategy.New<ScriptProcess>(false).Retrieve<ScriptProcess>("ID", processID);
		
		string text = String.Empty;
		
		if (process == null)
			text = "No process found.";
		else
			text = process.Output;
			
		OutputHolder.Controls.Add(new LiteralControl(text));
}
</script>
<html>
<head runat="server">
	<title>Default</title>
</head>
<body>
	<form id="form1" runat="server">
		<asp:Placeholder runat="server" id="OutputHolder">
		</asp:Placeholder>
	</form>
</body>
</html>
